#include "listener.hh"

Listener::Listener (ClientHandler* ch)
  : ios_ ()
  , acc_ (ios_, tcp::endpoint (tcp::v4 (), 7171))
  , ch_ (ch)
{
}

Listener::~Listener ()
{}

void
Listener::start ()
{
  while (true)
    {
      tcp::socket* sock = new tcp::socket (ios_);
      acc_.accept (*sock);

      ch_->new_client (sock);
    }

}
